package routers

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"ztool/common"
)

// indexPage 首页/**
func indexPage(c *gin.Context) {
	// 利用给定数据渲染模板，并将结果写入w
	c.HTML(http.StatusOK, "index.html", nil)
}

// loginPage 登录/**
func loginPage(c *gin.Context) {
	c.HTML(http.StatusOK, "login.html", nil)
}

// Streams 流列表页面/**
func streams(c *gin.Context) {
	c.HTML(http.StatusOK, "streams.html", common.GetZLConfig())
}

// videos 所有点位/**
func videos(c *gin.Context) {
	c.HTML(http.StatusOK, "devices.html", nil)
}

// square 视频广场/**
func square(c *gin.Context) {
	c.HTML(http.StatusOK, "square.html", nil)
}

// sdk /**
func sdk(c *gin.Context) {
	c.HTML(http.StatusOK, "sdk.html", nil)
}

// loadAnnoPagesRouter 将路由组注册进去
func loadAnnoPagesRouter(r *gin.Engine) {
	//首页
	r.GET("/", indexPage)
	r.GET("/login.html", loginPage)

	//流列表
	r.GET("/streams.html", streams)
	//所有点位
	r.GET("/devices.html", videos)
	//视频广场
	r.GET("/square.html", square)
	//SDK
	r.GET("/sdk.html", sdk)
}
